﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WebCache
{
    public interface ICache
    {
        string[] Keys{ get; }
        object this[string key] { get; set; }
        bool Exist(string key);
        T Get<T>(string key);
        bool TryGet<T>(string key, out T t);
        void Add<T>(string key, T t);
        void Add<T>(string key, T t, Func<T> updator);
        void SetUpdator<T>(string key, Func<T> updator);
        void Refresh<T>(string key);
        void RefreshAll();
        void Remove(string key);
        void Clear();
    }
}
